import axios from "axios"
const instance=axios.create({
    baseURL:'//10.15.59.210:8002',
    timeout:10000,
})
export const get=(url,params={},headers={}) => {
    return new Promise((resolve,reject) => {
        instance.get(url,{params, headers}).then((response) => {
            resolve(response.data)
        },(err) => {
            reject(err)
        })
    })
} 

export const post=(url,data={}) => {
    return new Promise((resolve,reject) => {
        instance.post(url,data,{
            headers:{
              'Content-Type':'application/json'
            }
        }).then((response) => {
            resolve(response.data)
        },(err) => {
            reject(err)
        })
    })
}